Skip to content

fix(web): rate-limit /api/docs/search - #1017

Merged
determined-001 merged 1 commit into
mainfrom
fix/docs-search-rate-limit
Aug 11, 2026
Merged

fix(web): rate-limit /api/docs/search#1017
determined-001 merged 1 commit into
mainfrom
fix/docs-search-rate-limit

Conversation

@determined-001

Copy link
Copy Markdown
Owner

Summary

  • /api/docs/search had zero throttling beyond a 128-char query cap while every other demo endpoint has a rate limit. Reuses the existing clientIp/checkWebhookCooldown pair from lib/demo-limits.ts, same pattern as /api/webhook-sample.
  • SearchDialog cast res.json() straight to SearchResult[] with no res.ok check, so a 429 envelope would have broken rendering - fixed alongside the rate limit that would trigger it.

Test plan

  • pnpm tsc --noEmit -p apps/web/tsconfig.json clean
  • pnpm --filter orbital/web build clean
  • CI green

The route had zero throttling beyond a 128-char query cap, unlike every
other demo endpoint. A scripted client could hit it at unlimited req/s
from one IP. Reuse the existing in-memory clientIp/checkWebhookCooldown
pair from lib/demo-limits.ts, same pattern as /api/webhook-sample.

SearchDialog cast res.json() straight to SearchResult[] with no res.ok
check, so a 429 envelope would have been treated as a result array and
broken rendering - fixed alongside the rate limit that would trigger it.
@vercel

vercel Bot commented Aug 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
orbital-dev Ready Ready Preview Aug 11, 2026 6:42pm

@determined-001
determined-001 merged commit b1d8e03 into main Aug 11, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants